#include "syscall.h"

void Count_to_10();
void tellAlphabets();

void Count_to_10()
{
	int i = 0;
	for (i= 0; i <= 10; i++)
	{
		WriteOutputInt(i, 1);	
	}
	Exit(1);
}

void tellAlphabets()
{
	Write("A\t", 3, 1);
	Write("B\t", 3, 1);
	Write("C\t", 3, 1);
	Write("D\t", 3, 1);
	Write("E\t", 3, 1);
	Write("F\t", 3, 1);
	Write("G\t", 3, 1);
	Write("H\t", 3, 1);
	Write("I\t", 3, 1);
	Write("J\t", 3, 1);
	
	Exit(1);
}

int main()
{	
	int i = 0;
	Write("Parent thread calling two Child threads to count to 10 and tell alphabets A - J\n", 84, 1);
	
	for (i = 0; i < 2; i++)
	{
		Fork(Count_to_10, "CountChild", 10);
		Fork(tellAlphabets, "AlphabetChild", 15);
	}
}
